{template 'member', 'header'}

<div class="realwrap main">
	<div class="tools clear" style="height:auto;padding:10px;">
		<div id="searchid" style="float:left;height:30px;">
				<form name="searchform" action="" method="get">
				<input type="hidden" value="member" name="m">
				<input type="hidden" value="shop" name="c">
				<input type="hidden" value="products" name="a">
				<table width="100%" cellspacing="0" class="search-form">
					<tbody>
						<tr>
						<td>
						<div class="explain-col">							
								产品类型：<select name="goodtype"><option value="" selected="">全部</option>
								<option value="day">全日房</option>
								<option value="time">小时房</option>
								<option value="goods">商品</option>
								</select>				
								产品状态：<select name="goodshow">
									<option value="" selected="">全部</option>
									<option value="1">显示</option>
									<option value="2">隐藏</option>
								</select>
								产品名：<input name="title" type="text" value="{safe_replace($_GET[title])}" class="input-text">
								<input type="submit" name="search" class="button" value="搜索">
					</div>
						</td>
						</tr>
					</tbody>
				</table>
				</form>
			</div>
			<a href="{APP_PATH}index.php?m=member&c=shop&a=add_product" class="btn_add" style="float:right;">添加产品</a>
	</div>
	<div class="table-list" style="margin:5px auto;">
		<table width="100%" style="border:1px solid #e2e2e2;">
			<thead>
				<tr>
				<th>ID</th>
				<th>产品类型</th>
				<th>产品名称</th>
				<th>描述</th>
				<th>库存数量</th>
				<th>价格</th>
				<th>状态</th>
				<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr>
				  {loop $listdata $val}
					<td align="center">{$val[id]}</td>
					<td align="center">{if $val[goodtype]=='time'}小时房{elseif $val[goodtype]=='day'}全日房{else}商品{/if}</td>
					<td align="center">{$val[title]}</td>
					<td align="center">{$val[description]}</td>
					<td align="center">{$val[stock]}</td>
					<td align="center">{$val[price]}元</td>
					<td align="center">显示</td>
					<td align="center"><a href="{APP_PATH}index.php?m=member&c=shop&a=edit_product&id={$val[id]}">修改</a> | <a href="{APP_PATH}index.php?m=member&c=shop&a=del_product&id={$val['order_id']}">删除</a></td>
				</tr>
				{/loop}
			</tbody>
		 </table>
		<div id="pages" class="text-c">{$pages}</div>
	</div>
</div>


{template 'member', 'footer'}